import 'package:syria_sports/core/app_export.dart';
import 'package:syria_sports/localization/app_localization.dart';
import 'package:flutter/material.dart';

import '../core/utils/pref_utils.dart';
import '../presentation/public_home_page/bloc/public_home_screen.dart';


class AccountDisabledDialogBody extends StatelessWidget {
  const AccountDisabledDialogBody({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    PrefUtils.clearPreferencesData();
    return WillPopScope(
      onWillPop: ()async{
        return false;
      },
      child: AlertDialog(
        shadowColor: Colors.grey,
        elevation: 16,
        scrollable: true,
        backgroundColor: Theme.of(context).colorScheme.secondary,
        title: const Text('تم تعطيل حسابك بشكل مؤقت' ),
        content: const Text('لا يمكنك الاستفادة من خدماتنا حاليا يرجى التواصل مع المدرب لحل المشكلة'),
        actions: [
          TextButton(
            onPressed: () {
              Navigator.of(context, rootNavigator: true).pushReplacement(
                MaterialPageRoute(
                  builder: (context) => const PublicHomeScreen(),
                ),
              );
            },
            child: Text('تيسجل خروج'.tr ,style: theme.textTheme.titleMedium?.copyWith(color: Colors.red),),
          ),
        ],
      ),
    );
  }
}
